import Taro, { Component } from '@tarojs/taro';
import { View, Text, Block } from '@tarojs/components';
import './ContentWrapper.scss';

export interface IContentWrapperProps {
    title: string;
    children: any;
}

class ContentWrapper extends Component<IContentWrapperProps, {}> {
    render() {
        const {title} = this.props;

        return (
            <View className='content_wrapper'>
                {title ? <Text className='header'>{title}</Text> : <View/>}
                <Block>{this.props.children}</Block>
            </View>
        );
    }
}

export default ContentWrapper;
